<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  
<div id="app">

  <!-- 1. checkout单选框 -->
  <!-- 如果没有绑定v-model则必须加上 name="sex" 进行单选库互斥 提交时name为key-->
  <!-- <label for="agree">
    <input type="checkbox" id="agree" v-model="isAgree"> 同意协议
  </label>

  <h2>你的选择是 {{isAgree}}</h2>
  <button :disabled="!isAgree">下一步</button> -->

  <!-- 2. checkout多选框 -->
  <input type="checkbox" value="篮球" v-model="hobbies">篮球
  <input type="checkbox" value="足球" v-model="hobbies">足球
  <input type="checkbox" value="乒乓球" v-model="hobbies">乒乓球
  <input type="checkbox" value="羽毛球" v-model="hobbies">羽毛球

  <h2>你的爱好是 {{hobbies}}</h2>

  <label v-for="item in originHobbies">
    <input type="checkbox" :value="item" v-model="hobbies">{{item}}
  </label>
</div>

<script src="../js/vue.js"></script>
<script>
  const app = new Vue({
    el: '#app',
    data:
    {
      message: 'Hello World',
      isAgree: false,
      hobbies: [],
      originHobbies: ['篮球', '足球', '乒乓球', '羽毛球', '台球', '高尔夫球'],
    },
  })  
</script>

</body>
</html>